package 蓝桥.模拟赛;

import java.util.Scanner;

public class Main7 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextInt();
        }
        int min_ou = Integer.MAX_VALUE;
        for (int i = 0; i < n; i++) {
            if (nums[i] % 2 == 0) {
                min_ou = Math.min(min_ou, nums[i]);
            }
        }
        if (min_ou == Integer.MAX_VALUE) {
            System.out.println(-1);
        } else {
            System.out.println(min_ou);
        }
    }
}
